﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Entities;
using Utility;
using BUS;


public partial class Administrator_doanhnghiep_modify : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            load_data();
        }
    }

    private void load_data()
    {
        int id = int.Parse(Request.QueryString["id"].ToString());
        Tbl_DoanhNghiep_Entities dn = Tbl_DoanhNghiep_BUS.GetByID(id);
        lit_tentaikhoan.Text = dn.TaiKhoan;
        txt_madoanhnghiep.Text = dn.MaDN;
        txt_tendoanhnghiep.Text = dn.TenDN;
        txt_diachi.Text = dn.DiaChi;
        txt_dienthoai.Text = dn.SDT;
        txt_website.Text = dn.WebSite;
        FreeTextBox1.Text = dn.GioiThieu;
        hd_stt.Value = dn.STT.ToString();
    }


    protected void bt_hoantat_Click(object sender, EventArgs e)
    {
        Tbl_DoanhNghiep_Entities dn = Tbl_DoanhNghiep_BUS.GetByID(int.Parse(hd_stt.Value));
        dn.TenDN = txt_tendoanhnghiep.Text;
        dn.MaDN=txt_madoanhnghiep.Text;
        dn.DiaChi=txt_diachi.Text;
        dn.SDT=txt_dienthoai.Text;
        dn.WebSite=txt_website.Text;
        dn.GioiThieu=FreeTextBox1.Text;
        dn.STT = int.Parse(hd_stt.Value);
        Tbl_DoanhNghiep_BUS.Update(dn);
    }
}
